<?php 
// +----------------------------------------------------------------------
// | @projectName  【order_system---点餐系统】
// +----------------------------------------------------------------------
// | @author        山西创客空间科技有限公司
// +----------------------------------------------------------------------
// | @date          2017年10月13日 星期五
// +----------------------------------------------------------------------
// | @Copyright     http://sx-ck.com All rights reserved.      
// +----------------------------------------------------------------------
namespace app\api\controller;

use app\admin\model\Common;
use app\common\Base;
use app\common\Error;
use think\Controller;
use think\Db;
use think\Request;

class StudentInfo extends Base
{
	private $sql = "SELECT a.* FROM students a ";

	//查询个人信息
	public function info() 
	{
		$student = Db::name('students');
		$stu_code = $this -> request -> post('student_code');
		$result = $student ->query($this -> sql."WHERE a.student_code='$stu_code'");
		if ($result === false) {
			return Base::echo_error(Error::DB_ERROR);
		}
		if (count($result) > 0) {
			return Base::echo_success($result);
		} else {
			return Base::echo_error("未注册");
		}
		
	}

	//查询用户余额
	// public function balance() 
	// {
		
	// }
}
 ?>
